Repository navigation
refactor: split tasks/threads actor.rs, supervision.rs and macros lib.rs into submodules - #278
Conversation
…tor_ref, lifecycle and test submodules
…licy_tests submodules
…andler and sim_test modules
…ches, update docs
…-large-files # Conflicts: # benchmarks/experiments/backend-experiments.patch
…-large-files # Conflicts: # benchmarks/experiments/backend-experiments.patch
…longer_enables_feature)
…-large-files # Conflicts: # benchmarks/experiments/backend-experiments.patch
…marks; map the ReadyGate Loom harness to benchmarks/experiments
…files # Conflicts: # benchmarks/experiments/backend-experiments.patch # concurrency/src/tasks/actor.rs
🤖 Gemini Code Review
This PR is a clean mechanical refactor splitting
Looks good to merge. Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Claude Code Review
Review: PR #278, split the largest source filesThe parts of the diff I could see are a faithful mechanical move. The diff is truncated partway through Suggestions1. Glob re-exports widen the public API surface (
|
🤖 Codex Code Review
No actionable findings. The split appears to preserve actor lifecycle, cancellation, message ordering, and supervision behavior. The updated experiment patch also applies cleanly. Tests could not run: the pinned toolchain requires an update blocked by filesystem permissions, and the installed stable toolchain lacks the cached Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 DeepSeek Code Review
This is a large mechanical split with a few issues worth addressing. Critical issue: re-export visibility in
|
🤖 Kimi Code Review
No blocking issues found in the shown diff. The supervision split preserves the public re-exports and effective visibility, and the locking, cancellation, and shutdown logic appears unchanged. The experimental Non-blocking suggestion: Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
🤖 Grok Code Review
The supervision move is behavior-preserving on the concurrency paths I can check (same locks, cancellation, and shutdown order). The problems are name resolution after the split, and one visibility narrowing. Broken relative paths in
Test helpers are not in the parent scope. #[cfg(test)]
use lifecycle::{run_actor, test_context};
pub(crate) use child::RecoveryQueue;Public API is now implicit. Batch yield placement at the end of the successful-dispatch arm is the right spot: the next iteration still hits the existing post-receive stop check, which is what Automated review by Grok (xAI) · grok-4.7 · custom prompt |
Splits the four largest source files mechanically, with no change to behaviour, public API or test names.
What moved where
concurrency/src/tasks/actor.rs(5.0k)actor.rs(traits,Context/ActorShared/ActorRefdefinitions,ActorStart,warn_on_block; 490 lines) +actor/envelope.rs,actor/context.rs,actor/actor_ref.rs,actor/lifecycle.rs(spawn,DeathFirst,run_actor*) + one file per test module (tests.rs,api_coverage.rs,stop_receive_probe.rs, ...)concurrency/src/threads/actor.rs(3.3k)threads/actor/(plusstop_wakeup_regression.rs)concurrency/src/supervision.rs(3.6k)supervision.rs(public spec types:RestartMode,Backoff,SupervisorConfig,ChildSpec, ...; 415 lines) +supervision/child.rs(recovery queue, view,SupervisedChild),state.rs(Core, budget, failures),builder.rs(SupervisorBuilder,Supervisor),run.rs(run_supervisor,run_child, ...),policy_tests.rs;nested.rsis unchangedmacros/src/lib.rs(2.3k)lib.rskeeps the documented#[proc_macro_attribute]entry points, each delegating to<module>::expand;protocol.rs,actor.rs,lints.rs,send_handler.rs,sim_test.rsHow it was done: a script moved line ranges verbatim and made every private item it moved
pub(super). A private item in the parent and apub(super)item in a child are visible in exactly the same modules, so the visibility is unchanged. Test modules kept their names, so their paths (tasks::actor::stop_receive_probe::..., whichverification.ymlchecks) are the same. Public items are still at the same paths, viapub use child::*. Generics,#[inline], crates and monomorphization are unchanged. The only non-move edit is that the macro entry points now callexpand.I did not extract a shared tasks/threads lifecycle module. The two dispatch loops look alike but differ in their receive and wakeup mechanics, so neither half is clearly identical, and merging them here would not be a pure move.
Also updated
verification/model-map.toml:tasks/actor/**andthreads/actor/**are mapped toLifecycle(andtasks/actor/**toReplyTimer).supervision/**was already mapped. No floors or allowlists changed, andcheck-model-sync.py events/modelspass locally.supervision/state.rsandsupervision/run.rs, andINDEX.tsvis updated. They apply again; the ones already stale onmain(04, 10-17, 19, 20) are unchanged.benchmarks/experiments/backend-experiments.patchis rebased onto the split. In a prepared tree, clippy passes withbackend-experimentsand theturn_regressionstests pass.cargo mutantsfile list, thesemantics.md"Checked by" paths, and TESTING.md, the TLA README, CLAUDE.md and CHANGELOG.Checks run locally
clippy with
-D warningson the workspace (default and--all-features), on--no-default-features+ metrics, and onlifecycle-trace,failpoints,metrics,diagnostics.cargo check --testsunder--cfg spawned_simand--cfg spawned_scheduler_loom.cargo test -p spawned-concurrency --lib(243 passed, the same as before), theprotocol_compiletrybuild UI tests, andcargo fmt --check.Model: no change because this only moves code between files (no behaviour change); the moved paths are mapped in model-map.toml so they stay covered.